﻿using Microsoft.AspNetCore.Mvc;

namespace HCMS.Web.Manage.ViewComponents
{
    /// <summary>
    /// 上传 视图组件 公共处理方法
    /// </summary>
    public class UploadCommonViewComponent: ViewComponent
    {
        public UploadCommonViewComponent() { 
        
        }

        /// <summary>
        /// 组件执行方法
        /// </summary>
        /// <param name="fieldName">图片字段名称</param>
        /// <param name="imgPath">图片路径</param>
        /// <returns></returns>
        public async Task<IViewComponentResult> InvokeAsync(string fieldName, string imgPath) {
            ViewData["fieldName"] = fieldName;
            ViewData["imgPath"] = imgPath;

            return View();
        }
    }

    //--------------------- 上传 视图组件类 ---------------

    #region 单图上传
    /// <summary>
    /// 单图上传
    /// </summary>
    public class UploadSingleImgViewComponent : UploadCommonViewComponent
    {

    }
    #endregion

    #region 多图上传
    /// <summary>
    /// 多图上传
    /// </summary>
    public class UploadMultipleImgViewComponent : UploadCommonViewComponent
    {

    }
    #endregion

}
